//
//  NSManagedObject+MySecureUserInformation.m
//  SingleViewCoreData
//
//  Created by Hai on 5/28/13.
//  Copyright (c) 2013 Administrator. All rights reserved.
//

#import "NSManagedObject+MySecureUserInformation.h"

@implementation NSManagedObject (MySecureUserInformation)
- (void) setPassword:(NSString *)aPassword
{
    NSString * username= [self valueForKey:@"username"];
    NSLog (@"Get here to setPassword");
    if (username) {
        [KeyChainHelper setPassword:aPassword forKey:username];
    }
}

- (NSString*) password
{
    NSString * username= [self valueForKey:@"username"];
    if (username) {
        return [KeyChainHelper getPasswordForKey:username];
    }
    return nil;
}
@end
